<template>
  <div>
    <el-table :data="futurestableData" border :header-cell-style="{ background: '#eef1f6' }">
      <el-table-column type="index" label="序号" width="50">
      </el-table-column>
      <el-table-column prop="TradingDay" label="日期" sortable></el-table-column>
      <el-table-column prop="RealAccountCode" label="客户号"></el-table-column>
      <el-table-column
        prop="RealAccountName"
        label="客户名称"
      ></el-table-column>
      <el-table-column
        prop="BrokerID" width="110"
        label="期货公司名称"
      ></el-table-column>
      <el-table-column
        prop="ExchangeName"
        label="交易所"
      ></el-table-column>
      <el-table-column prop="ProductName" label="品种"></el-table-column>
      <el-table-column prop="InstrumentID" label="合约"></el-table-column>
      <el-table-column prop="DirectionName" label="方向"></el-table-column>
      <el-table-column prop="HedgeFlagName" label="投/保"></el-table-column>
      <el-table-column
        prop="Volume"
        label="持仓量"
      ></el-table-column>
      <el-table-column prop="OpenPrice" label="开仓价"></el-table-column>
      <el-table-column
        prop="OpenDate"
        label="开仓日期" width="105"
        sortable
      ></el-table-column>
      <el-table-column prop="LastSettlementPrice" label="昨结算"></el-table-column>
      <el-table-column prop="SettlementPrice" label="结算价"></el-table-column>
      <el-table-column
        prop="float_profit_loss"
        label="浮动盈亏"
      ></el-table-column>
      <el-table-column prop="mark_profit_loss" label="盯市盈亏"></el-table-column>
      <el-table-column
        prop="Margin"
        label="保证金"
      ></el-table-column>
    </el-table>
  </div>
</template>
<script>
import { conrealpos } from '../../../../../api/url_lcc';
export default {
  //期初开账-衍生品头寸
  name: "futuresPosition",
  data() {
    return {
      futurestableData: []
    };
  },
  methods: {
  //  持仓明细接口
    futures_getData(){
       let params = {
             "brokerid":"",
            "realaccountcode":"",
            "instrumentid":"",
            "product_id":"",
            "trade_source":"",
            "start_date":"",
            "end_date":"",
            begin_flag:"1",
        };
        conrealpos(params).then(res => {
            if (res.errcode == "1") {
              this.futurestableData = []
              this.futurestableData = res.result.results
            } else {
                this.$message.error(res.msg);
            }
        });
    },
  },
  mounted(){
    this.futures_getData();
  }
};
</script>
